package io.renren.modules.crawler.utils;

import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.message.BasicHttpResponse;
import org.apache.http.HttpStatus;

import java.io.IOException;

/**
 * Created by zhangheng on 2017/9/20.
 */
public class HTTPUtils {

    public static HttpResponse getRawHtml(HttpClient client, String url){

        HttpGet httpGet = new HttpGet(url);
        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
        try {
            response = client.execute(httpGet);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return response;
    }
}
